@import 'variables';
// reset
* {
  box-sizing: border-box;
  outline: none;
}
html {
  font-size: 13px;
}
body {
  margin: 0;
  background-color: #f1f1f1;
  line-height: 1.2em;
  font-family: Arial, Helvetica, sans-serif;
}
a {
  color: #999;
}

@each $colorKey, $color in $colors {
  .text-#{$colorKey} {
    color: $color;
  }
  .bg-#{$colorKey} {
    background-color: $color;
  }
}

// text-align
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var;
  }
}

@each $sizeKey, $size in $font-sizes {
  .fs-#{$sizeKey} {
    font-size: $size * $base-font-size !important;
  }
}

// text-ellipsis
.text-ellipsis {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// flex
.d-flex {
  display: flex;
}
.flex-column {
  flex-direction: column;
}
.flex-1 {
  flex: 1;
}
.flex-wrap {
  flex-wrap: wrap;
}
@each $key, $value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}

@each $key, $value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

@each $typeKey, $typeValue in $spacing-types {
  @each $sizeKey, $sizeValue in $spacing-sizes {
    // m-1 => margin:0.25rem
    .#{$typeKey}-#{$sizeKey} {
      #{$typeValue}: $sizeValue * $spacing-base;
    }
    // mx-1 margin-left,margin-right  my-1
    .#{$typeKey}x-#{$sizeKey} {
      #{$typeValue}-left: $sizeValue * $spacing-base;
      #{$typeValue}-right: $sizeValue * $spacing-base;
    }
    .#{$typeKey}y-#{$sizeKey} {
      #{$typeValue}-top: $sizeValue * $spacing-base;
      #{$typeValue}-bottom: $sizeValue * $spacing-base;
    }
    @each $directionKey, $directionValue in $spacing-directions {
      // mt-1 margin-top:0.25rem
      .#{$typeKey}#{$directionKey}-#{$sizeKey} {
        #{$typeValue}-#{$directionValue}: $sizeValue * $spacing-base;
      }
    }
  }
}

// w100% h100%
.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

// btn
.btn {
  border: none;
  border-radius: 0.2308rem;
  padding: 0.3rem 0.5rem;
}

// nav
.nav {
  display: flex;
  .nav-item {
    padding-bottom: 2px;
    border-bottom: 3px solid transparent;
    &.active {
      color: map-get($colors, 'primary');
      border-bottom: 3px solid map-get($colors, 'primary');
    }
  }
  &.nav-inverse {
    .nav-item {
      color: map-get($colors, 'white');
      padding-bottom: 2px;
      border-bottom: 3px solid transparent;
      &.active {
        border-bottom: 3px solid #fff;
      }
    }
  }
}

// sprite
.sprite {
  background: url('../index.png') no-repeat;
  background-size: 375px;
  display: inline-block;
  &.sprite-news {
    background-position: 63.546% 15.517%;
    width: 1.7692rem;
    height: 1.5385rem;
  }
  &.sprite-arrow {
    background-position: 38.577% 52.076%;
    width: 0.7692rem;
    height: 0.7692rem;
  }
}

// iconfont
